// ActionScript file
package com.app.commands{
    import com.adobe.cairngorm.commands.ICommand;
    import com.adobe.cairngorm.control.CairngormEvent;
    import com.app.business.MahasiswaDelegate;
    import com.app.control.GetDokTaMahasiswaEvent;
    import com.app.model.ModelLocator;
    import com.app.vo.MahasiswaVO;
    
    import mx.controls.Alert;
    import mx.rpc.IResponder;
    public class GetDokTaMahasiswaCommand implements ICommand,IResponder{
        private var model:ModelLocator=ModelLocator.getInstance();
        
        public function execute(event : CairngormEvent):void{
            model.mahasiswa.isPending=true;
            var delegate :MahasiswaDelegate = new MahasiswaDelegate(this);
            var  getDokTaMahasiswa:GetDokTaMahasiswaEvent = GetDokTaMahasiswaEvent(event); 
            delegate.getDokTaMahasiswa(getDokTaMahasiswa.mahasiswaVo);
        }
        
        public function result(data:Object):void{
            model.mahasiswa.isPending=true;
            model.mahasiswa.mahasiswaVo=MahasiswaVO(data);
        }
        
        public function fault(info:Object):void{
            Alert.show( "Get Dokument TA Failed","Alert");
            model.mahasiswa.isPending = false;
        }
        
        
    }
}